<h1>Listing payments</h1>

<table>
  <thead>
    <tr>
      <th>Invoice</th>
      <th>Amount</th>
      <th>Change</th>
      <th>Payment method</th>
      <th>Card number</th>
      <th>Card provider</th>
      <th>Card transaction ref</th>
      <th>Created at</th>
      <th>Updated at</th>
      <th>Created by</th>
      <th>Updated by</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @payments.each do |payment| %>
      <tr>
        <td><%= payment.invoice_id %></td>
        <td><%= payment.amount %></td>
        <td><%= payment.change %></td>
        <td><%= payment.payment_method_id %></td>
        <td><%= payment.card_number %></td>
        <td><%= payment.card_provider_id %></td>
        <td><%= payment.card_transaction_ref %></td>
        <td><%= payment.created_at %></td>
        <td><%= payment.updated_at %></td>
        <td><%= payment.created_by %></td>
        <td><%= payment.updated_by %></td>
        <td><%= link_to 'Show', payment %></td>
        <td><%= link_to 'Edit', edit_payment_path(payment) %></td>
        <td><%= link_to 'Destroy', payment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Payment', new_payment_path %>
